package cn.com.bluemoon.daps.common.validation.datasource;


import cn.com.bluemoon.daps.common.validation.illegal.CheckIllegalChar;
import cn.com.bluemoon.daps.common.validation.illegal.IllegalChar;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Documented
@Constraint(validatedBy = EnvironmentCheck.class)
public @interface IllegalNumber {


    String name() default "";

    String message() default "{数据源环境不正确}";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    /**
     * Defines several {@link IllegalChar} annotations on the same element.
     *
     *
     */
    @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
    @Retention(RUNTIME)
    @Documented
    @interface List {

        IllegalNumber[] value();
    }

}
